import { Injectable, OnInit } from '@angular/core';
import { Observable, throwError as _observableThrow, of as _observableOf, Subscription } from 'rxjs';
import { HttpClient } from '@angular/common/http';
import { NullTemplateVisitor } from '@angular/compiler';

@Injectable({
  providedIn: 'root'
})
export class VstudentinfoService implements OnInit {

  url = "http://10.84.111.205:21021/";
  //vstudyList: any[];
  constructor(public http: HttpClient) {


  }

  ngOnInit(): void {

  }

  async getVStudyListByTypeId(attTypeId) {


    let listUrl_ = this.url + "api/services/app/Tenant/GetVStudyList";
    listUrl_ = listUrl_.replace(/[?&]$/, "");
    let options_: any = {
      observe: "response",
      responseType: 'json',
      params: { attTypeId: attTypeId }


    };

    const sq = this.http.get(listUrl_, options_);//.subscribe((response: any) => { this.vstudyList = response.body.result; }
    //Subscription
    //)
    return sq;


  }
  async getVStudyList() {


    let listUrl_ = this.url + "api/services/app/Tenant/GetVStudyList";
    listUrl_ = listUrl_.replace(/[?&]$/, "");
    let options_: any = {
      observe: "response",
      responseType: 'json',
     
    };

    const sq = this.http.get(listUrl_, options_);//.subscribe((response: any) => { this.vstudyList = response.body.result; }
    //Subscription
    //)
    return sq;


  }

  async getVStudyDetailList(attId) {
    let listUrl_ = this.url + "api/services/app/Tenant/GetVStudyDetailList";
    listUrl_ = listUrl_.replace(/[?&]$/, "");
    let options_: any = {
      observe: "response",
      responseType: 'json',
      params: { attId: attId }
    };

    const sq = this.http.get(listUrl_, options_);//.subscribe((response: any) => { this.vstudyList = response.body.result; }
    //Subscription
    //)
    return sq;


  }

  async getAttTypeList() {
    let listUrl_ = this.url + "api/services/app/Tenant/GetAttachTypeList";
    listUrl_ = listUrl_.replace(/[?&]$/, "");
    let options_: any = {
      observe: "response",
      responseType: 'json'


    };

    const sq = this.http.get(listUrl_, options_);//.subscribe((response: any) => { this.vstudyList = response.body.result; }
    //Subscription
    //)
    return sq;


  }
}
